#include "BreakPointService.h"
#include <iostream>

BreakPointService::BreakPointService()
:seqNo(-1)
{
}
BreakPointService::~BreakPointService()
{
}


//Event 1: Service  Started
void BreakPointService::start(){
    seqNo = 0;
    std::cout << "BreakPointService::start from: " << seqNo << std::endl;
}


void BreakPointService::sendMessage(const char * msg){
    std::cout << "BreakPointService::send : [" << msg << "] " 
        << std::endl;
}
//Event 2:   Connection Connected:
void BreakPointService::connected(){
  std::string msg = "login_req";
  msg += std::to_string(seqNo);
    sendMessage(msg.c_str());
}

//Event 3:  Receive Normal Message
void BreakPointService::receivedNormalResp(const char * msg){
    std::cout << "BreakPointService::receive :[" << msg << "]" << std::endl;
    ++seqNo; //fake action
}

//Event 4: Connection Disconnected
void BreakPointService::disconnected(){
    std::cout << "BreakPointService::disconnected " << std::endl;
}


//Event 5: Stop Service 
void BreakPointService::stop(){
    std::cout << "BreakPointService::stop to: " << seqNo << std::endl;
    seqNo = 0;
}


void BreakPointService::receivedLoginResp(const char * msg){
    std::cout << "BreakPointService::receive :[" << msg << "]" 
        << std::endl;
}

